package com.cskaoyan.javase.oop3._1interface._1basic.extend;

/**
 * 接口中的默认方法,可以配合接口的多实现
 * 实现真正意义上 的多继承
 *
 * @since 17:05
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo {
    public static void main(String[] args) {
        A a = new A();
        a.test1();
        a.test2();
        a.test3();
        a.test4();
    }
}

// com.cskaoyan.javase.oop3._1interface._1basic.extend.A inherits unrelated defaults for test1() from types com.cskaoyan.javase.oop3._1interface._1basic.extend.IA and com.cskaoyan.javase.oop3._1interface._1basic.extend.IB
class A implements IA, IB, IC, ID {

}

interface IA {
    default void test1() {
        System.out.println("AAAA");
    }
}

interface IB {
    default void test2() {
        System.out.println("bbbb");
    }
}

interface IC {
    default void test3() {
        System.out.println("cccc");
    }
}

interface ID {
    default void test4() {
        System.out.println("dddd");
    }
}
